using AutoMapper;
using BW.WMS.WareHouseStatistics;
using BW.WMS.WareHouseStatistics.SalesReturns;
using BW.WMS.WareHouseStatistics.StockManagement;
using BW.WMS.WareHouseAllot;
using BW.WMS.WareHouseAllot.Parameter.Input.GoodsType;
using BW.WMS.WareHouseManage;
using BW.WMS.WareHouseManage.Dtos;
using BW.WMS.WareHouseCheck;
using BW.WMS.WareHouseCheck.DTO;
using BW.WMS.WareHouseAllot.Parameter.Output.GoodsType;
using BW.WMS.WareHouseAllot.Parameter.Output.Doccode;
using BW.WMS.WareHouseStatistics.Sales;
using BW.WMS.WareHouseAllot.Dto.GoodsType;
using BW.WMS.WareHouseAllot.Dto.DocCode;
using BW.WMS.WareHouseAllot.Dto.Goods;
using BW.WMS.WareHouseAllot.Parameter.Output.Goods;
using BW.WMS.WareHouseAllot.Dto.Allot;

namespace BW.WMS;

public class WMSApplicationAutoMapperProfile : Profile
{
    public WMSApplicationAutoMapperProfile()
    {
        /* You can configure your AutoMapper mapping configuration here.
         * Alternatively, you can split your mapping configurations
         * into multiple profile classes for a better organization. */



        #region 仓库报表
        //入库管理
        CreateMap<StockManagementModel, StockManagementDto>().ReverseMap();

        CreateMap<StockManagementModel,CreateUpdateStockManagementDto>().ReverseMap();

        //销售退货管理
        CreateMap<SalesReturnsModel, SalesReturnsDto>().ReverseMap();

        CreateMap<SalesReturnsModel, CreateUpdateSalesReturnsDto>().ReverseMap();

        //销售
        CreateMap<SalesModel,SalesDto>().ReverseMap();

        CreateMap<SalesModel, CreateUpdateSalesDto>().ReverseMap();

        #endregion

        #region 仓库管理

        CreateMap<WareHouseManage.Warehouse, WareHouseManage.Dtos.WarehouseDto>();
        CreateMap<AddWarehouseDto, Warehouse>();

        // 添加库区映射配置
        CreateMap<Zone, ZoneDto>();
        CreateMap<AddZoneDto, Zone>();

        CreateMap<Zone, ZoneDto>();
        CreateMap<UpdateZoneDto, Zone>();

        #endregion

        #region 仓库调拨
        //货品类型
        CreateMap<WareHouseAllot.GoodsTypeModel, GoodsTypeDto>();
        CreateMap<WareHouseAllot.Parameter.Input.GoodsType.AddGoodsTypeInput, WareHouseAllot.GoodsTypeModel>();

        CreateMap<WareHouseAllot.Parameter.Input.GoodsType.AddGoodsTypeInput, GoodsTypeDto>();
        CreateMap<GoodsTypeModel, GoodsTypeOutput>();
        CreateMap<WareHouseAllot.Parameter.Input.GoodsType.UpdateGoodsTypeInput, WareHouseAllot.GoodsTypeModel>();

        //货品信息
        CreateMap<WareHouseAllot.GoodsModel,GoodsDto>();
        CreateMap<WareHouseAllot.Parameter.Input.Goods.AddGoodsInput, WareHouseAllot.GoodsModel>();

        CreateMap<WareHouseAllot.Parameter.Input.GoodsType.AddGoodsTypeInput, GoodsDto>();
        CreateMap<GoodsModel, GoodsOutput>();
        CreateMap<WareHouseAllot.Parameter.Input.Goods.UpdateGoodsInput, WareHouseAllot.GoodsModel>();


        //仓库调拨
        CreateMap<WareHouseAllot.AllotModel, AllotDto>().ReverseMap();
        CreateMap<WareHouseAllot.Parameter.Input.Allot.AddAllotInput, WareHouseAllot.AllotModel>().ReverseMap();


        //自动生成编码,
        CreateMap<WareHouseAllot.DoccodeModel, DoccodeDto>();
        CreateMap<WareHouseAllot.Parameter.Input.Doccode.AddDoccodeInput, WareHouseAllot.DoccodeModel>();
        CreateMap<DoccodeModel, DoccodeOutput>();
        #endregion

        #region 仓库盘点
        CreateMap<WareHouseCheck.StockTaking, WarehouseDTO>().ReverseMap();
        CreateMap<StockTaking, EditWarehouseDTO>().ReverseMap();

        CreateMap<WareHouseCheck.Department, DepartmentDTO>().ReverseMap();
        CreateMap<Department,CreateDept>().ReverseMap();


        #endregion
    }
}
